# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.DiscoveryClient do
  @moduledoc """
  Represents an installed Migration Center Discovery Client instance.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the discovery client was first created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Free text description. Maximum length is 1000 characters.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Free text display name. Maximum length is 63 characters.
  *   `errors` (*type:* `list(GoogleApi.MigrationCenter.V1.Model.Status.t)`, *default:* `nil`) - Output only. Errors affecting client functionality.
  *   `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Client expiration time in UTC. If specified, the backend will not accept new frames after this time.
  *   `heartbeatTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Last heartbeat time. Healthy clients are expected to send heartbeats regularly (normally every few minutes).
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Labels as key value pairs.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. Full name of this discovery client.
  *   `serviceAccount` (*type:* `String.t`, *default:* `nil`) - Required. Service account used by the discovery client for various operation.
  *   `signalsEndpoint` (*type:* `String.t`, *default:* `nil`) - Output only. This field is intended for internal use.
  *   `source` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. Full name of the source object associated with this discovery client.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. Current state of the discovery client.
  *   `ttl` (*type:* `String.t`, *default:* `nil`) - Optional. Input only. Client time-to-live. If specified, the backend will not accept new frames after this time. This field is input only. The derived expiration time is provided as output through the `expire_time` field.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the discovery client was last updated. This value is not updated by heartbeats, to view the last heartbeat time please refer to the `heartbeat_time` field.
  *   `version` (*type:* `String.t`, *default:* `nil`) - Output only. Client version, as reported in recent heartbeat.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :errors => list(GoogleApi.MigrationCenter.V1.Model.Status.t()) | nil,
          :expireTime => DateTime.t() | nil,
          :heartbeatTime => DateTime.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :serviceAccount => String.t() | nil,
          :signalsEndpoint => String.t() | nil,
          :source => String.t() | nil,
          :state => String.t() | nil,
          :ttl => String.t() | nil,
          :updateTime => DateTime.t() | nil,
          :version => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:displayName)
  field(:errors, as: GoogleApi.MigrationCenter.V1.Model.Status, type: :list)
  field(:expireTime, as: DateTime)
  field(:heartbeatTime, as: DateTime)
  field(:labels, type: :map)
  field(:name)
  field(:serviceAccount)
  field(:signalsEndpoint)
  field(:source)
  field(:state)
  field(:ttl)
  field(:updateTime, as: DateTime)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.DiscoveryClient do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.DiscoveryClient.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.DiscoveryClient do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
